package org.jdsm.flow.core.users.impl.gae.objectify;

import com.googlecode.objectify.Ref;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.annotation.Unindex;
import org.jdsm.flow.core.users.IUser;

import java.util.ArrayList;
import java.util.List;

/**
 * User: mikom
 * Date: 11/22/12
 * Time: 4:36 PM
 */
@Entity
public class User implements IUser<Long> {
    @Id
    private Long id;
    @Index
    private String name;
    @Index
    private String nickName;
    @Unindex
    private String password;
    @Unindex
    private String hint = "";

    private List<Ref<Role>> roles = new ArrayList<Ref<Role>>();
    private List<Ref<Group>> groups = new ArrayList<Ref<Group>>();


    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getNickName() {
        return nickName;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getHint() {
        return hint;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setHint(String hint) {
        this.hint = hint;
    }

    public List<Ref<Role>> getRoles() {
        return roles;
    }

    public void setRoles(List<Ref<Role>> roles) {
        this.roles = roles;
    }

    public List<Ref<Group>> getGroups() {
        return groups;
    }

    public void setGroups(List<Ref<Group>> groups) {
        this.groups = groups;
    }
}
